<template>
  <div>
    <el-table :data="list" height="640" border style="width: 100%;margin-top: -20px">
      <el-table-column type="index" width="60"></el-table-column>
      <el-table-column prop="num" label="歌单序号" width="60"></el-table-column>
      <el-table-column prop="list_name" label="标题" width="180"></el-table-column>
      <el-table-column prop="tag" label="标签" width="120"></el-table-column>
      <el-table-column prop="profile" label="简介" width="120" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column prop="itemid" label="歌曲ID"></el-table-column>
      <el-table-column prop="itemname" label="歌曲名" width="120"></el-table-column>
      <el-table-column prop="artist" label="歌手名" width="120"></el-table-column>
      <el-table-column prop="album" label="专辑名" width="180"></el-table-column>
      <el-table-column prop="cp" label="唱片公司" width="180"></el-table-column>
      <el-table-column prop="exclusivity" label="付费方式"></el-table-column>
    </el-table>
    <el-pagination background layout="total, prev, pager, next, jumper" :total="total" :page-size="ps" @current-change="listMethod">
    </el-pagination>
  </div>
</template>
<script>
import apis from "@utils/apis";
import webQuerySource from "@comps/cms/WebQuerySource.vue";

export default {
  data() {
    return {
      pn: 1,
      ps: 1000,
      total: 0,
      source: 'all',
      list: [],
      items: {},
    }
  },

  components: {
    webQuerySource,
  },

  mounted() {
    this.listMethod()
  },

  methods: {
    listMethod(page) {
      let loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      this.pn = page || 1
      apis.matchSongListApi({
        pn: this.pn,
        ps: this.ps,
        source: this.source,
      }).then(res => {
        loading.close();
        this.total = res.result.total
        this.list = res.result.docs
        this.items = {}
      })
    },

  }
}

</script>
